﻿<%@ Page Title="Subscriber" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="crm_back_list.aspx.cs" Inherits="Sami_SMS_CRM_UI.crm_back_list" MaintainScrollPositionOnPostback="true" %>

<%@ Register Src="UserControl/ucPaging.ascx" TagName="ucPaging" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CssContent" runat="server">
    <style type="text/css">
        .box-content p{margin:2px 0 0 5px;}
        .box-content p span{display: inline-block; width: 110px;}
        .detail{color: #555555; text-decoration:none;}
        .detail:hover{text-decoration:underline;}
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            RegisterDialog();
        });

        function dialog() {
            OpenDialog("dialog1");
        }
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div class="box">
        <div class="box-title">
            Searching
        </div>
        <div class="box-content ui-widget-content">
            <p>
                <span>Subscriber</span>
                <asp:TextBox ID="txtSubscriber" runat="server" />
            </p>
            <p>
                <span>Enable</span>
                <asp:DropDownList ID="ddlEnable" runat="server">
                    <asp:ListItem Value="">---</asp:ListItem>
                    <asp:ListItem Value="true">True</asp:ListItem>
                    <asp:ListItem Value="false">False</asp:ListItem>
                </asp:DropDownList>
            </p>
            <p style="text-align:center">
                <asp:Button ID="btnSearching" runat="server" Text="Search" CssClass="ui-button" 
                    onclick="btnSearching_Click" />
            </p>
        </div>
    </div>
    <div class="box">
        <div class="box-title clearfix">
            <div class="fl">
                Black List
            </div>
            <div class="fr">
                <asp:ImageButton ID="btnAddNew" runat="server" ImageUrl="~/img/icons/ws/ic_plus.png"
                    ToolTip="Add New" OnClick="btnAddNew_Click" />
            </div>
        </div>
        <div class="box-content">
            <div class="clearfix" style="height: 32px">
                <div class="fl">
                    Show
                    <asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
                        <asp:ListItem Value="5">5</asp:ListItem>
                        <asp:ListItem Value="10">10</asp:ListItem>
                        <asp:ListItem Value="20">20</asp:ListItem>
                        <asp:ListItem Value="50" Selected="True">50</asp:ListItem>
                        <asp:ListItem Value="100">100</asp:ListItem>
                        <asp:ListItem Value="150">150</asp:ListItem>
                        <asp:ListItem Value="200">200</asp:ListItem>
                    </asp:DropDownList> /
                    <asp:Literal ID="ltrTotalRow" runat="server" Text="0" />
                    entries
                </div>
                <div class="fr">
                    <uc1:ucPaging ID="pagingtop" runat="server" />
                </div>
            </div>
            <div class="clearfix">
                <asp:GridView ID="rptTable" runat="server" CssClass="table" 
                    AutoGenerateColumns="false" Width="100%" onrowcommand="rptTable_RowCommand">
                    <Columns>
                        <asp:TemplateField HeaderText="No">
                            <ItemStyle Width="45px" HorizontalAlign="Center" />
                            <ItemTemplate>
                                <%#(Container.DataItemIndex +1) + (pagingtop.CurrentPage - 1) * pagingtop.PageSize %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="subscriber" DataField="subscriber" ItemStyle-Width="120px" />
                        <asp:BoundField HeaderText="operator_id" DataField="operator_id"  ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField HeaderText="description" DataField="description" />
                        <asp:BoundField HeaderText="enabled" DataField="enabled"  ItemStyle-Width="80px"/>
                        <asp:TemplateField HeaderText="Control">
                            <ItemStyle Width="80px" HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:LinkButton Text="Edit" runat="server" CommandName="Edited"
                                    CommandArgument='<%#Eval("subscriber")%>' />
                                    &nbsp;
                                <asp:LinkButton Text="Delete" runat="server" CommandName="Deleted"
                                    CommandArgument='<%#Eval("subscriber")%>' OnClientClick="return confirm('Are you sure delete?');" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <div class="fr">
                    <uc1:ucPaging ID="pagingbottom" runat="server" />
                </div>
            </div>
        </div>
    </div>
    <div class="dialog-form" id="dialog1" style="margin: auto; width: 480px;" title="CRM back list">
        <div>
            <asp:HiddenField ID="hdfAction" runat="server" />
            <asp:HiddenField ID="hdfId" runat="server" />
            <p>
                <span>Subscriber</span>
                <asp:TextBox ID="txtSubs" runat="server" onkeypress="return ValidateKeypress(/[\d]/,event);"/>
            </p>
            <p>
                <span>OperatorId</span>
                <asp:TextBox ID="txtOperator_Id" runat="server" onkeypress="return ValidateKeypress(/[\d]/,event);" />
            </p>
            <p>
                <span>Description</span>
                <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" />
            </p>
            <p>
                <span>Enabled</span>
                <asp:DropDownList ID="ddlEnabled" runat="server">
                    <asp:ListItem Value="true">True</asp:ListItem>
                    <asp:ListItem Value="false">False</asp:ListItem>
                </asp:DropDownList>
            </p>
            <div style="text-align: right; margin-top: 5px; padding-top: 5px; border-top: 1px solid #C3C3C3;">
                <asp:Button ID="btnOK" runat="server" Text="OK" CssClass="ui-button" OnClick="btnOK_Click" />
                <input type="button" value="Cancel" onclick='$("#dialog1").dialog("close");'
                    class="ui-button" />
            </div>
        </div>
    </div>
    <input type="hidden" id="formId" value="crm_back_list" />
</asp:Content>
